package edu.wfu.preparedDishes.commodity.dao;

import edu.wfu.preparedDishes.commodity.entity.CartEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import edu.wfu.preparedDishes.commodity.entity.CartVo;
import edu.wfu.preparedDishes.commodity.entity.commodityVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 购物车记录表;
 * 
 * @author hero_miracle
 * @email hero_miracle@gmail.com
 * @date 2023-11-22 13:06:46
 */
@Mapper
public interface CartDao extends BaseMapper<CartEntity> {

    void add(@Param("id") String id);

    void addMore(@Param("id") String id,@Param("num") Integer num);

    void reduce(@Param("id")String id);

    Integer getNum(@Param("userId") String userId);

    List<CartVo> queryListWithPagination(@Param("pageSize") int pageSize,
                                         @Param("offset") int offset,
                                         @Param("userId") String userId);

    Integer sum(@Param("userId") String userId);

    CartEntity isHaveBySkuId(@Param("skuId") String skuId,@Param("userId") String userId);
	
}
